import { defineStore } from 'pinia';
import { getCommonData as getCommonDataApi } from '@/api/common';
import { CommonData } from '@/api/types';
export const useCommonStore = defineStore('common', () => {
    const hotTagList = ref<string[]>([]);
    const allTagList = ref<string[]>([]);
    const articlesCategoryList = ref<any[]>([]);

    const getCommonData = async () => {
        const res = await getCommonDataApi();
        hotTagList.value = res.data.hotTagList;
        allTagList.value = res.data.allTagList;
        articlesCategoryList.value = res.data.articlesCategoryList;
    }


    return {
        allTagList,
        hotTagList,
        articlesCategoryList,
        getCommonData
    }
})